﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;

public class MapPanel : MonoBehaviour {


	public GameObject ActiveSettlement;
	public List<GameObject> Settlements;
	public Map_Settlements ActiveSettlementScript;
	public CenterOnScrollRect m_ScrollCenter;


	// Use this for initialization
	void OnEnable () 
	{
		if (PlayerPrefs.GetInt("ActiveSettlement") > -1)
		{
			ActiveSettlement = Settlements [PlayerPrefs.GetInt("ActiveSettlement")];
			
		}

		ActiveSettlementScript = ActiveSettlement.GetComponent<Map_Settlements>();
		ActiveSettlementScript.CheckConnection();
		m_ScrollCenter.CenterOnItem(ActiveSettlement.GetComponent<RectTransform>());
		
	}
	
	// Update is called once per frame
	void Update () 
	{
	
	}
}
